import { getDicListAxios, addDicAxios, delDicAxios, fixDicAxios } from "../../http/apis/userManageApi"


export default {
    //获取字典信息
    getDicListActions({ commit }, params) {
        return new Promise((resolve, reject) => {
            getDicListAxios(params)
                .then(res => {
                    commit("getDicListMutations", res.data.data)
                    resolve(res)
                })
                .catch(err => {
                    console.log(err);
                    reject()
                })
        })

    },
    //添加字典信息
    addDicActions(context, params) {
        return new Promise((resolve, reject) => {
            addDicAxios(params)
                .then(res => {
                    console.log(res);
                    resolve(res)
                })
                .catch(err => {
                    console.log(err);
                    reject()
                })
        })

    },
    //删除字典信息
    delDicActions(context, params) {
        return new Promise((resolve, reject) => {
            delDicAxios(params)
                .then(res => {
                    console.log(res);
                    resolve(res)
                })
                .catch(err => {
                    console.log(err);
                    reject()
                })
        })
    },
    //修改字典信息
    fixDicActions(context, params) {
        return new Promise((resolve, reject) => {
            fixDicAxios(params)
                .then(res => {
                    console.log(res);
                    resolve(res)
                })
                .catch(err => {
                    console.log(err);
                    reject()
                })
        })
    },

}